跳到主要内容

数学符号及其 JavaScript 对应符号列表


| Symbol | Name | Since | Example | JavaScript | |
| ------- | ---------------------------------------------------------------- | ------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- |
| ― | Horizontal bar for division | ~1300 | ba​ | ```<br>a / b<br>``` | |
| + | Plus sign | 1360 | a+b | ```<br>a + b<br>``` | |
| - | Minus sign | 1489 | a−b | ```<br>a - b<br>``` | |
| √ | Radical symbol | 1525 | x​ | ```<br>Math.sqrt(x)<br>``` | |
| (...) | Parentheses | 1544 | (a+b) | ```<br>(a + b)<br>``` | |
| = | Equals | 1557 | a=b | ```<br>// equality<br>a == b<br><br>// assignment<br>a = b<br>``` | |
| . | Decimal separator | 1593 | 1.75 | ```<br>1.75<br>``` | |
| × | Multiplication sign | 1618 | a×b | ```<br>a * b<br>``` | |
| ± | Plus–minus sign | 1628 | a±2 | ```<br>[a - 2, a + 2]<br>``` | |
| ⁿ√ | Radical symbol for nth root | 1629 | na​ | ```<br>Math.pow(a, 1/n)<br>``` | |
| < | Strict inequality less-than | 1631 | a<b | ```<br>a < b<br>``` | |
| > | Strict inequality greater-than | 1631 | a>b | ```<br>a > b<br>``` | |
| xʸ | Superscript notation | 1636 | ab | ```<br>a ** b<br>``` | |
| x | Use of the letter x for an independent variable or unknown value | 1637 | x | ```<br>// declare<br>let x = 0<br><br>// usage<br>x<br><br>// re-assign<br>x = 2<br>``` | |
| % | Percent sign | 1650 | n% | ```<br>n / 100<br>``` | |
| ∞ | Infinity sign | 1655 | ∞ | ```<br>Infinity<br>``` | |
| ÷ | Division sign | 1659 | a÷b | ```<br>a / b<br>``` | |
| ≤ | Unstrict inequality less-than sign | 1670 | a≤b | ```<br>a <= b<br>``` | |
| ≥ | Unstrict inequality greater-than sign | 1670 | a≥b | ```<br>a >= b<br>``` | |
| d | Differential sign | 1675 | m=dxdy​ | ```<br>m = (y2 - y1) / (x2 - x1)<br>``` | |
| ∫ | Integral sign | 1675 | ∫18​f(x)⋅dx | ```<br>let dx = 1/8 // step size<br>let sum = 0<br><br>for (let x=1; x<=8; x += dx) {<br> sum += f(x) * dx<br>}<br>``` | |
| : | Colon for division | 1684 | a:b | ```<br>a / b<br>``` | |
| · | Middle dot for multiplication | 1698 | a⋅b | ```<br>a * b<br>``` | |
| ⁄ | Division slash | 1718 | a/b | ```<br>a / b<br>``` | |
| ≠ | Inequality sign | unknown | a=b | ```<br>a != b<br>``` | |
| x' | Prime symbol for derivative | 1748 | x′ | ```<br>// TODO<br>``` | |
| Σ | Summation symbol | 1755 | i=0∑10​i | ```<br>let sum = 0<br><br>for(let i=0; i<10; i++) {<br> sum += i<br>}<br>``` | |
| ∝ | Proportionality sign | 1768 | yx​αba​ | ```<br>x/y == a/b<br>``` | |
| ∂ | Partial differential sign | 1770 | | ```<br>// TODO<br>``` | |
| ≡ | Identity sign | 1801 | a≡b | ```<br>a === b<br>``` | |
| [x] | Integral part (aka floor) | 1808 | [x] | ```<br>Math.floor(x)<br>``` | |
| ! | Factorial | 1808 | n! | ```<br>function factorial(n) {<br> if (n == 0) return 1<br><br> return n * factorial(n - 1)<br>}<br>``` | |
| Π | Product symbol | 1812 | x=2∏4​(x+1) | ```<br>let product = 1<br>let x = 2<br><br>for (let i=0; i<4; i++) {<br> product *= (x + 1)<br>}<br>``` | |
| ⊂ | Set subset of | 1817 | a⊂b | ```<br>let a = new Set(...)<br>let b = new Set(...)<br><br>a.isSubsetOf(b)<br>``` | |
| ⊃ | Set superset of | 1817 | a⊃b | ```<br>let a = new Set(...)<br>let b = new Set(...)<br><br>a.isSupersetOf(b)<br>``` | |
| \|...\| | Absolute value notation | 1841 | ∣x∣ | ```<br>Math.abs(x)<br>``` | |
| ‖...‖ | Matrix notation | 1843 | ∥x∥ | ```<br>// TODO<br>``` | |
| ∩ | Intersection | 1888 | a∩b | ```<br>let a = new Set(...)<br>let b = new Set(...)<br><br>a.intersection(b)<br>``` | |
| ∪ | Union | 1888 | a∪b | ```<br>let a = new Set(...)<br>let b = new Set(...)<br><br>a.union(b)<br>``` | |
| ∈ | Membership sign | 1894 | a∈b | ```<br>let a = ...<br>let b = new Set(...)<br><br>b.has(a)<br>``` | |
| {...} | Curly brackets for set notation | 1895 | {x,y,z} | ```<br>new Set([x, y, z])<br>``` | |
| ∃ | Existential quantifier (there exists) | 1897 | (∃x) f(x) | ```<br>let array = [ ... ]<br><br>array.some(x => f(x))<br>``` | |
| · | Dot product | 1902 | a⋅b | ```<br>let a = [...]<br>let b = [...]<br>let sum = 0<br><br>assert(a.length == b.length)<br><br>for (let i=0; i<a.length;i++) {<br> sum += a[i] * b[i]<br>}<br>``` | |
| × | Cross product | 1902 | a×b | ```<br>let a = [x1, y1, z1]<br>let b = [x2, y2, z2]<br><br>[<br> (a[1] * b[2]) - (a[2] * b[1]),<br> (a[2] * b[0]) - (a[0] * b[2]),<br> (a[0] * b[1]) - (a[1] * b[0])<br>]<br>``` | |
| ∨ | Logical disjunction (aka OR) | 1906 | a∨b | ```<br>a \| b<br>``` | |
| (...) | Matrix round bracket notation | 1909 | (ax​by​cz​) | ```<br>[<br> [a, b, c],<br> [x, y, z]<br>]<br>``` | |
| [...] | Matrix square bracket notation | 1909 | [ax​by​cz​] | ```<br>[<br> [a, b, c],<br> [x, y, z]<br>]<br>``` | |
| ∀ | Universal quantifier (for all) | 1935 | (∀x) f(x) | ```<br>let array = [ ... ]<br><br>array.every(x => f(x))<br>``` | |
| ∅ | Empty set sign | 1939 | ∅ | ```<br>new Set()<br>``` | |
| ⌊x⌋ | Greatest integer ≤ x (aka floor) | 1962 | ⌊x⌋ | ```<br>Math.floor(x)<br>``` | |
| ⌈x⌉ | Smallest integer ≥ x (aka ceiling) | 1962 | ⌈x⌉ | ```<br>Math.ceil(x)<br>``` | |

Created by [Joshua Nussbaum](https://x.com/joshnuss)